<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateDataVersionTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('data_version', function (Blueprint $table) {
//            $table->comment('学期');
            $table->bigInteger('id', true);
            $table->string('title', 45)->nullable()->comment('显示名:如 2019上学期');
            $table->dateTime('start_date')->nullable();
            $table->dateTime('end_date')->nullable()->comment('版本编号');
            $table->dateTime('activity_end_date')->nullable();
            $table->string('description', 5000)->nullable();
            $table->timestamp('created_at')->useCurrent();
            $table->timestamp('updated_at')->useCurrentOnUpdate()->useCurrent();
            $table->bigInteger('creator_id')->nullable();
            $table->bigInteger('updater_id')->nullable();
            $table->integer('deleted')->nullable()->default(0);
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('data_version');
    }
};
